/**	\file loc_msgmanager.h This file contains declarations of variables and functions of the message manager module.
*/
#ifndef LOC_MSGMANAGER_H
#define LOC_MSGMANAGER_H
#include "loc_types.h"
#include "LOC_utils.h"
#include "ses_manager.h"
#include <avr/eeprom.h>
#include <avr/pgmspace.h>



/************************/
/* Configuration Section*/
/************************/

#define MSG_MESSAGE_STORAGE_LENGTH			169
#define MSG_NUM_OF_STORED_MESSAGES			3

extern const u8 PROGMEM MSG_u8LUT[];

#define MSG_vidSAVE_FUNCTION_END_CBK()        SES_vidSetWriteEnded()
#define MSG_u8RESET_MCU                     /**/

/*****************/
/* Exported Types*/
/*****************/
typedef u16 (*MSG_tu16GetChar)(void);

/*********************/
/* External Functions*/
/*********************/

extern MSG_tu16GetChar		        MSG_u16GetReadyChar;

/** Initializes the Message manager component.
*/
extern void MSG_vidInit(void);

/** Informs the message manager to start saving the messages.
*/
extern void MSG_vidStartSavingMessages(void);

/** Adds charachters to the message buffer to be stored.
*/
extern TYP_tu8Bool MSG_bAddToMsgBuff(const u8 * const pu8Buffer, u8 u8Length );

/** Enables the saving of the function in the preiodic task.
*/
extern void MSG_vidSaveMessage(u8 u8MessageNumber);

/** The periodic function for the Message manager component.
*/
extern void MSG_vidMainFunction(void);

/** Saves message number to be the current message to be viewed and resets the MCU.
*/
extern void MSG_vidUpdateMessage(u8 MsgNumber);


/** Returns a pointer in the LUT to the first byte of the next charachter to be viewed in the stored message.
*/
extern u16 MSG_u16GetStoredChar(void);

/** Returns a pointer in the LUT to the first byte of the next charachter to be viewed in the message.
*/
extern u16 MSG_u16GetRamChar(void);


#endif /*LOC_MSGMANAGER_H*/
























